package com.sskj.tibi.ui.activity;


import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.flyco.tablayout.SlidingTabLayout;
import com.sskj.lib.RConfig;
import com.sskj.tibi.R;
import com.sskj.tibi.R2;
import com.sskj.tibi.presenter.RecordActivityPresenter;
import com.sskj.lib.base.BaseActivity;

import java.util.ArrayList;

import butterknife.BindView;


@Route(path = RConfig.TIBI_RECORD)
public class RecordActivity extends BaseActivity<RecordActivityPresenter> {
    @BindView(R2.id.slidingTabLayout)
    SlidingTabLayout slidingTabLayout;
    @BindView(R2.id.viewPager)
    ViewPager viewPager;

    @Override
    protected int getLayoutId() {
        return R.layout.tibi_activity_record;
    }

    @Override
    public RecordActivityPresenter getPresenter() {
        return new RecordActivityPresenter();
    }

    @Override
    protected void initView() {
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.TIBI_FRAGMENT_RECHARGE_RECORD).navigation());
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.TIBI_FRAGMENT_WITHDRAW_RECORD).navigation());
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.TIBI_FRAGMENT_OTHER_RECORD).navigation());
        slidingTabLayout.setViewPager(viewPager, new String[]{"充币", "提币", "其他"}, this, fragments);
    }
}
